package com.example.downloadupload.animation;

import org.vaadin.jouni.animator.Animator;
import org.vaadin.jouni.animator.AnimatorProxy;
import org.vaadin.navigator7.Page;

import com.vaadin.event.LayoutEvents.LayoutClickEvent;
import com.vaadin.event.LayoutEvents.LayoutClickListener;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Button.ClickEvent;


public class CategorieButton extends VerticalLayout implements LayoutClickListener{


	boolean bo = false;
	Animator anim;

	public CategorieButton(VerticalLayout parentCategorie, VerticalLayout childCategorie){

		parentCategorie.addListener(this);
		this.addComponent(parentCategorie);
		
		

		anim = new Animator(childCategorie);


	}


	public void layoutClick(LayoutClickEvent event) {
		CategorieButton.this.addComponent(anim);

		if (bo==false){
			anim.rollDown(500, 200);
			bo=true;
		}else{
			anim.rollUp(300, 200);
			bo=false;
		}

	}


}
